import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
import {Subscription} from "rxjs/Subscription";
import {HomepageService} from "@homepage/homepage.service";
import {ImageServeService} from "@shared/service/image/image-serve.service";
@Component({
  selector: 'person-service',
  templateUrl: './homepage-service.component.html',
  styleUrls: ['./homepage-service.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class HomepageServiceComponent implements OnInit {
  public defaultPicture: string;
  public serviceData: any;
  subscription: Subscription = new Subscription();
  scrollContainer;

  @Input() userId: any;

  constructor(public homepageService: HomepageService,
              private imgService: ImageServeService) {
    this.defaultPicture = this.imgService.getPersonalDefault();
    this.serviceData = this.homepageService.getservice;
  }

  /**
   * @description 判断认证状态
   * @author baoww765
   * @date 2017-12-17
   * @param authStatus
   * */
  checkStatus(authStatus) {
    return authStatus === 1 ? '认证中' : (authStatus === 2 ? '未通过' : '已通过');
  }

  ngOnInit() {
    this.scrollContainer = document.querySelector('#seed-scroll-content');
  }

}
